<template>
  <div class="ai-head">
    <div class="logo-wrapper">
      <img src="@/assets/logo.png"/>
      <span>{{ title }}</span>
    </div>
    <div class="operate-wrapper" v-if="isYueShu">
      <svg-icon
        icon-class="min-window"
        @click="minHandle"
      ></svg-icon>
      <svg-icon
        icon-class="close-window"
        @click="closeHandle"
      ></svg-icon>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  mounted () { },
  computed: {
    isYueShu () {
      return process.env.VUE_APP_NAME === 'yueshu'
    },
    isDll () {
      return process.env.VUE_APP_NAME === 'dll'
    },
    isRepairMaster () {
      return process.env.VUE_APP_NAME === 'repairmaster'
    },
    title () {
      if (this.isYueShu) {
        return '小智AI助手'
      } else if (this.isDll || this.isRepairMaster) {
        return 'AI助手'
      }
      return ''
    }
  },
  methods: {
    minHandle () {
      this.$xz('xz_minimize_dialog', process.env.VUE_APP_WINDOW_NAME)
    },
    closeHandle () {
      this.$xz('xz_switch_dialog', process.env.VUE_APP_WINDOW_NAME, false)
    }
  }
}
</script>

<style scoped lang="scss">
.ai-head{
  position: fixed;
  height:46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width:calc(100% - 15px);
  padding:0 5px 0 10px;
  z-index: 10;
  .logo-wrapper{
    display: flex;
    align-items: center;
    gap:5px;
    font-weight: 400;
    font-size: 12px;
    img{
      width:20px;
      height:20px;
    }
  }
  .operate-wrapper{
    display: flex;
    align-items: center;
    gap:5px;
    .svg-icon{
      cursor: pointer;
      font-size:20px;
      &:hover{
        opacity: .8;
      }
    }
  }
}
</style>
